#ifndef __CONFIG_H__
#define __CONFIG_H__
#include <cstdlib>
#include <iostream>
#include <list>
#include <stdio.h>
#include <assert.h>

using namespace std;

// Cache configuration
#define L1_LATENCY 5
#define L1_BLOCK_SIZE 2
#define L1_ASSOCIATIVITY 512

#define L2_LATENCY 20
#define L2_BLOCK_SIZE 4
#define L2_ASSOCIATIVITY 2

#define MEM_LATENCY 200

#ifdef DEBUG_OUT
#define dprint(fmt, ...) \
  printf(fmt, __VA_ARGS__);  \
  printf("\n");   \
  fflush(stdout);
#else
#define dprint(...)
#endif

struct Block {
  bool valid;
  bool dirty;
  int tag;
  list<Block*> evict_list;
  int owner; // Which core owns this block (for L2)
  unsigned long last_cyc; //for LRU
  unsigned long addr; //sample addr
};

enum Cmd {R, W, RSP, WB, EVICT, FILL};
int log2(int in);
extern unsigned long cur_cyc;
extern unsigned long at;
#endif
